package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo01 {
    public static void main(String[] args) throws IOException {
        String str = "我爱Java";
        FileOutputStream fos = new FileOutputStream("f1.txt");
        byte[] data = str.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        str="Hello Tedu";
        fos.write(str.getBytes(StandardCharsets.UTF_8));
        fos.close();



    }
}
